<template>
  <div class="bdous">
    <div class="tob">
      <div class="imgs" @click="toshang">
        <img src="../assets/syb.png" alt="" />
      </div>
      <div class="text">设置</div>
    </div>
    <ul class="logo">
      <li class="toxiang" @click="totx">
        <div class="around">
          <div class="toxiang">
            <img :src="userInfo.avatar" alt="" />
          </div>
          <div class="logotext">
            <span class="nicheng">昵称：{{ userInfo.nickname }}</span>
            <span class="zhangh">账号：{{ userInfo.username }}</span>
          </div>
          <div class="totc">
            <img src="../assets/syb.png" alt="" />
          </div>
        </div>
      </li>
      <li class="shohuo" @click="shoh">
        <div class="around xiahuanx">
          <div class="texts">
            <span>我的收货地址</span>
          </div>
          <div class="totc">
            <img src="../assets/syb.png" alt="" />
          </div>
        </div>
      </li>
    </ul>

    <ul class="logo bianju">
      <li class="shohuo">
        <div class="around">
          <div class="texts">
            <span>账号安全</span>
          </div>
          <div class="totc">
            <img src="../assets/syb.png" alt="" />
          </div>
        </div>
      </li>

      <li class="shohuo">
        <div class="around xiahuanx">
          <div class="texts">
            <span>支付</span>
          </div>
          <div class="totc">
            <img src="../assets/syb.png" alt="" />
          </div>
        </div>
      </li>
    </ul>
    <ul class="logo bianju">
      <li class="shohuo">
        <div class="around">
          <div class="texts">
            <span>消息通知</span>
          </div>
          <div class="totc">
            <img src="../assets/syb.png" alt="" />
          </div>
        </div>
      </li>

      <li class="shohuo">
        <div class="around xiahuanx">
          <div class="texts">
            <span>隐私</span>
          </div>
          <div class="totc">
            <img src="../assets/syb.png" alt="" />
          </div>
        </div>
      </li>
    </ul>
    <ul class="denglon">
      <li @click="logOut">退出登录</li>
      <li>切换账号</li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "shezhi",
  data() {
    return {
      userInfo: [],
    };
  },
  created() {
    this.user();
  },
  methods: {
    user() {
      this.userInfo = JSON.parse(localStorage.getItem("userInfo"));
      console.log(this.userInfo);
    },
    toshang() {
      this.$router.push("/my");
    },
    logOut() {
      localStorage.removeItem("token");
      localStorage.removeItem("userInfo");
      this.$router.push("/login");
    },
    totx() {
      this.$router.push("/information");
    },
    shoh() {
      this.$router.push("/sitellitile");
    },
  },
};
</script>

<style lang="less" scoped>
.xiahuanx {
  border-top: 1px solid rgb(209, 209, 209);
}
.logo {
  width: 100%;
  // height: 120px;
  // border: 1px solid #000;
  .around {
    margin-left: 10px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    height: 100%;
    // border-top: 1px solid rgb(190, 190, 190);
  }
  li {
    background-color: rgb(255, 255, 255);
    .totc {
      height: 15px;
      transform: rotate(180deg);
      width: 15px;
      img {
        width: 100%;
        height: 100%;
      }
    }
  }

  .shohuo {
    height: 40px;
    .texts {
      flex: 1;
      span {
        font-size: 16px;
        color: rgb(41, 41, 41);
      }
    }
  }
  .toxiang {
    height: 80px;
    // border-bottom: 1px solid rgb(224, 224, 224);

    .toxiang {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      overflow: hidden;

      img {
        width: 100%;
        height: 100%;
      }
    }
    .logotext {
      margin-left: 10px;
      display: flex;
      flex: 1;
      flex-direction: column;
      .nicheng {
        margin-bottom: 5px;
        font-size: 17px;
      }
      .zhangh {
        color: rgb(177, 177, 177);
        margin-top: 5px;
      }
    }
  }
}
.tob {
  height: 50px;
  display: flex;
  align-items: center;
  .sj();
  .text {
    margin-left: 5px;
    margin-top: 3px;
    font-size: 17px;
  }
  .imgs {
    width: 20px;
    height: 20px;
    // border: 1px solid #000;
    img {
      width: 100%;
      height: 100%;
    }
  }
}

.bdous {
  height: 100%;
  background-color: @background;
  .bianju {
    margin-top: 10px;
  }
  .denglon {
    // height: 100px;

    li {
      height: 40px;
      // border: 1px solid #000;
      margin-top: 10px;
      background-color: rgb(255, 255, 255);
      text-align: center;
      line-height: 40px;
    }
    // border: 1px solid #000;
  }
}
</style>